<template>
  <view class="home">
    <view class="header">
      <image src="/static/logo.svg" class="logo"/>
      <swiper :autoplay="true" indicator-dots>
        <swiper-item>
          <image src="/static/banner1.svg" class="banner"/>
        </swiper-item>
        <swiper-item>
          <image src="/static/banner2.svg" class="banner"/>
        </swiper-item>
      </swiper>
    </view>
    <view class="content">
      <view @click="navigateTo('schedule')" class="card">
        <image src="/static/schedule-icon.svg" class="icon"/>
      </view>
      <view @click="navigateTo('personal')" class="card">
        <image src="/static/personal-icon.svg" class="icon"/>
      </view>
      <view @click="navigateTo('teacher-info')" class="card">
        <image src="/static/teacher-info-icon.svg" class="icon"/>
      </view>
      <view @click="navigateTo('course-info')" class="card">
        <image src="/static/course-info-icon.svg" class="icon"/>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      token: ''
    };
  },
  created() {
  },
  methods: {
    navigateTo(page) {
      uni.navigateTo({
        url: `/${page}?token=${this.token}`
      });
    }
  }
};
</script>

<style scoped>
.home {
  background-color: #fce4ec;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  width: 150px;
  margin-top: 20px;
}

.banner {
  width: 100%;
  height: 200px;
}

.content {
  flex: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.card {
  width: 100px;
  height: 100px;
  margin: 10px;
  background-color: #ffccbc;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon {
  width: 50px;
  height: 50px;
}
</style>